<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="家具,顺德家具,木材,沙发" />
<meta name="description" content="顺德家具厂" />
<title>佛山市顺德区宝源家具实业公司</title>
<script language="javascript" src="resource/images/qq.js"></script>
<script language="javascript" src="resource/js/asd.js"></script>
<script src="resource/js/jquery-1.8.3.min.js" type="application/javascript"></script>
<link href="resource/css/index.css" rel="stylesheet" type="text/css" />
<link href="resource/css/<?php echo $_GET['a']=!empty($_GET['a'])?$_GET['a']:'index';?>.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="layer" style="width:100%; height:100%; position:absolute; z-index:1; opacity:0.3;filter: alpha(opacity=30);-moz-opacity: 0.3; -khtml-opacity: 0.3; background:#fff; display:none; text-align:center;">
    <ul style="width:300px; height:200px; margin:auto; margin-top:22%; z-index:2; text-align:center; line-height:200px; background:#03C; font-size:16px; color:#FFF; font-weight:bolder; "></ul>
</div>
<div id="container">
	<div class="header">
    	<div class="headTop">
        	<div class="logo">
            	<a href="<?php echo ROOT_PATH.'mvc/';?>index.php"><img src="resource/images/logo.gif" alt="佛山市顺德区宝源家具实业公司" title="佛山市顺德区宝源家具实业公司" /></a>
            </div>
            <div class="headRight">
            	<div class="tool">
                    <?php  if(empty($_SESSION['user'][0]['user'])):?>
                    <form id="loginform" method="post" action="index.php?c=index&a=index" style="float:left;display:none;">
                        <label>用户名：</label><input type="text" style="width:90px;" name="loginname"  value="<?php if(!empty($_COOKIE['loginname'])) echo $_COOKIE['loginname'];?>"/>
                        <label>密码：</label><input type="password"  style="width:90px;" name="loginpwd"  value="<?php if(!empty($_COOKIE['loginpwd'])) echo $_COOKIE['loginpwd'];?>"/>
                        <label>记住密码：</label><input type="checkbox" name="rem" <?php if(!empty($_COOKIE['loginpwd'])){echo  'checked="checked"';};?>/>
                        <label>验证码：</label><input type="text"  id="checkNum"  name="verify" size="4" />
                        <img class="image" height="20px;" src="<?php echo ROOT_PATH.'mvc/protected/model/verify.php';?>" />
                        <input type="submit" value="登录" style="width:33px; font-size:12px;" /></form>
                        <a href="javascript:;" class="sub">登录</a>|<a id="setf" onClick="fa(this)" href="index.php?c=user&a=login" onmousedown="return ns_c({'fm':'behs','tab':'favorites','pos':0})">注册</a>
                    <?php else:?>
                        <form id="out" method="post" action="index.php?c=index&a=index"  style="float:right;">
                            <b><?php echo $_SESSION['user'][0]['user'];?>,您好，欢迎登录！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;
                            <input name="out" type="submit" style="width:33px; font-size:12px;" value="退出"/>
                            </b>
                        </form>
                    <?php endif;?>
                </div>
               <ul class="nav">
                    <li class="navLeft"></li>
                    <li class="navCenter">
                    	<a href="index.html">公司简介</a>
                        <a href="product.html">产品展示</a>
                        <a href="index.php?c=news&a=list">新闻中心</a>
                        <a href="message.html">给我留言</a>
                        <a href="links.html">友情链接</a>
                        <a href="address.html">联系我们</a>
                        <a href="index.php?c=user&a=login" class="last">会员注册</a>
                    </li>
                    <li class="navRight"></li>
                </ul><!-- 避免多DIV症 -->
            </div>
        </div>
        <div class="banner"><img src="resource/images/banna.jpg" /></div>
    </div>
<script type="text/javascript">
    $('.sub').click(function(){
        $(this).prev().slideToggle();
        if($(this).html()=='登录'){
            $(this).html('隐藏');
        }else{
            $(this).html('登录');
        }
    })
    $('.image').click(function(){
       var src=$(this).attr('src');
       src=src.substr(0,52);
       src=src+='?p='+Math.random();
       $(this).attr('src',src);
    })
    
     $('#loginform').submit(function(){
        if($('#checkNum').val().length=='0'){
        alert('请输入验证码！');
        return false; 
       };

        var url=document.URL;
        url=url.substr(0,36);
        url=url+'?c=index&a=index';

        var loginname=$('input[name="loginname"]').val();
        
        var loginpwd=$('input[name="loginpwd"]').val();
        var verify=$('input[name="verify"]').val();
        var rem=$('input[name="rem"]').is(':checked');
        rem=rem?1:0;
        $.ajax({
            type:'post',
            url:url,
            data:{
                loginname:loginname,
                loginpwd:loginpwd,
                verify:verify,
                rem:rem
            },
            dataType:"json",
            success:function(json){
                // alert(json)
                if(json==1){
                    alert('用户名或密码错误！');
                }else if(json==2){
                    alert('该账户未激活！');
                }else if(json==3){
                    alert('您输入的验证码不正确！');
                }else{
                    for(var i=0;i<json.row.length;i++){
                
                
                    var str='';
                        str+='<form id="out" method="post" action="index.php?c=index&a=index"  style="float:right;">';
                        str+='<b>'+json.row[i].user+',您好，欢迎登录！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;';
                        str+='<input name="out" type="submit" style="width:33px; font-size:12px;" value="退出"/>';
                        str+='</b>';
                        str+='</form>';
                        }           
                        $('.tool').html(str);
                   }     
            }
            
        })

        return false;
    })
    
</script>